<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
           "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title>Coverage Report</title>
<link title="Style" type="text/css" rel="stylesheet" href="css/main.css"/>
<script type="text/javascript" src="js/popup.js"></script>
</head>
<body>
<h5>Coverage Report - org.azeckoski.reflectutils.DeepUtils</h5>
<div class="separator">&nbsp;</div>
<table class="report">
<thead><tr>  <td class="heading">Classes in this File</td>  <td class="heading" width="20%"><a class="dfn" href="help.html" onclick="popupwindow('help.html'); return false;">Line Coverage</a></td>  <td class="heading" width="20%"><a class="dfn" href="help.html" onclick="popupwindow('help.html'); return false;">Branch Coverage</a></td>  <td class="heading" width="10%"><a class="dfn" href="help.html" onclick="popupwindow('help.html'); return false;">Complexity</a></td></tr></thead>
  <tr><td class="text"><a href="org.azeckoski.reflectutils.DeepUtils.html">DeepUtils</a></td><td class="value"><table cellpadding="0" cellspacing="0" align="right"><tr><td>73%&nbsp;</td><td><table class="percentGraph" cellpadding="0" cellspacing="0" width="100"><tr><td class="covered" width="73"></td><td class="uncovered" width="26"></td></tr></table></td></tr></table></td><td class="value"><table cellpadding="0" cellspacing="0" align="right"><tr><td>88%&nbsp;</td><td><table class="percentGraph" cellpadding="0" cellspacing="0" width="100"><tr><td class="covered" width="87"></td><td class="uncovered" width="12"></td></tr></table></td></tr></table></td><td class="value"><span class="hidden">0.0;</span>0</td></tr>
</table>
<div class="separator">&nbsp;</div>
<table cellspacing="0" cellpadding="0" class="src">
<tr>
  <td class="numLine">&nbsp;1</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">/**</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;2</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment"> * $Id: org.azeckoski.reflectutils.DeepUtils.html 28 2008-10-02 16:17:03Z azeckoski $</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;3</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment"> * $URL: http://reflectutils.googlecode.com/svn/maven/site/cobertura/org.azeckoski.reflectutils.DeepUtils.html $</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;4</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment"> * FieldUtils.java - genericdao - May 19, 2008 10:10:15 PM - azeckoski</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;5</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment"> **************************************************************************</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;6</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment"> * Copyright (c) 2008 Aaron Zeckoski</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;7</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment"> * Licensed under the Apache License, Version 2.0</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;8</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment"> * </span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;9</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment"> * A copy of the Apache License has been included in this </span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;10</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment"> * distribution and is available at: http://www.apache.org/licenses/LICENSE-2.0.txt</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;11</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment"> *</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;12</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment"> * Aaron Zeckoski (azeckoski @ gmail.com) (aaronz @ vt.edu) (aaron @ caret.cam.ac.uk)</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;13</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment"> */</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;14</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;15</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="keyword">package</span> org.azeckoski.reflectutils;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;16</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;17</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> java.lang.ref.SoftReference;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;18</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> java.lang.reflect.Array;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;19</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> java.util.ArrayList;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;20</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> java.util.Collection;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;21</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> java.util.HashMap;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;22</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> java.util.List;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;23</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> java.util.Map;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;24</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> java.util.Set;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;25</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> java.util.Map.Entry;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;26</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;27</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> org.azeckoski.reflectutils.ClassFields.FieldsFilter;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;28</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> org.azeckoski.reflectutils.beanutils.FieldAdapter;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;29</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> org.azeckoski.reflectutils.exceptions.FieldGetValueException;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;30</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> org.azeckoski.reflectutils.exceptions.FieldSetValueException;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;31</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> org.azeckoski.reflectutils.exceptions.FieldnameNotFoundException;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;32</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> org.azeckoski.reflectutils.map.ArrayOrderedMap;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;33</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;34</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">/**</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;35</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment"> * Class which provides methods for handling deep operations: &lt;br/&gt;</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;36</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment"> * deep copy - make a copy of one object into another which traverses the entire object and duplicates all data down to immutable/simple fields &lt;br/&gt;</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;37</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment"> * deep clone - clone an object by traversing it and making a copy of every field &lt;br/&gt;</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;38</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment"> * deep map - turn an object into a map with only simple objects in it, all contained objects become nested maps &lt;br/&gt;</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;39</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment"> * populate - turn a map into an object, can handle params maps (from a servlet request) and nested or non-nested string-&gt;object maps</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;40</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment"> * </span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;41</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment"> * @author Aaron Zeckoski (azeckoski @ gmail.com)</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;42</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment"> */</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;43</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="keyword">public</span> <span class="keyword">class</span> DeepUtils {</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;44</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;45</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="comment">/**</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;46</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * Empty constructor</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;47</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * &lt;br/&gt;</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;48</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * &lt;b&gt;WARNING:&lt;/b&gt; use the {@link #getInstance()} method to get this rather than recreating it over and over</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;49</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     */</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;50</td>
  <td class="nbHitsCovered">&nbsp;9</td>
  <td class="src"><pre class="src">&nbsp;    <span class="keyword">public</span> DeepUtils() {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;51</td>
  <td class="nbHitsCovered">&nbsp;9</td>
  <td class="src"><pre class="src">&nbsp;        DeepUtils.setInstance(<span class="keyword">this</span>);</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;52</td>
  <td class="nbHitsCovered">&nbsp;9</td>
  <td class="src"><pre class="src">&nbsp;    }</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;53</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;54</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="keyword">protected</span> ClassDataCacher getClassDataCacher() {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;55</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;        <span class="keyword">return</span> ClassDataCacher.getInstance();</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;56</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    }</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;57</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;58</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="keyword">protected</span> ConstructorUtils getConstructorUtils() {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;59</td>
  <td class="nbHitsCovered">&nbsp;35</td>
  <td class="src"><pre class="src">&nbsp;        <span class="keyword">return</span> ConstructorUtils.getInstance();</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;60</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    }</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;61</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;62</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="keyword">protected</span> ConversionUtils getConversionUtils() {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;63</td>
  <td class="nbHitsCovered">&nbsp;12</td>
  <td class="src"><pre class="src">&nbsp;        <span class="keyword">return</span> ConversionUtils.getInstance();</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;64</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    }</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;65</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;66</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="keyword">protected</span> FieldUtils getFieldUtils() {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;67</td>
  <td class="nbHitsCovered">&nbsp;304</td>
  <td class="src"><pre class="src">&nbsp;        <span class="keyword">return</span> FieldUtils.getInstance();</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;68</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    }</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;69</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;70</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="keyword">protected</span> FieldAdapter getFieldAdapter() {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;71</td>
  <td class="nbHitsCovered">&nbsp;34</td>
  <td class="src"><pre class="src">&nbsp;        <span class="keyword">return</span> getFieldUtils().getFieldAdapter();</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;72</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    }</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;73</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;74</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="comment">/**</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;75</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * Deep clone an object and all the values in it into a brand new object of the same type,</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;76</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * this will traverse the bean and will make new objects for all non-null values contained in the object</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;77</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * </span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;78</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param &lt;T&gt;</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;79</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param object any java object, this can be a list, map, array, or any simple</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;80</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * object, it does not have to be a custom object or even a java bean,</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;81</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * also works with DynaBeans</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;82</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param maxDepth the number of objects to follow when traveling through the object and copying</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;83</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * the values from it, 0 means to only copy the simple values in the object, any objects will</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;84</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * be ignored and will end up as nulls, 1 means to follow the first objects found and copy all</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;85</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * of their simple values as well, and so forth</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;86</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param fieldNamesToSkip (optional) the names of fields to skip while cloning this object,</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;87</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * this only has an effect on the bottom level of the object, any fields found</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;88</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * on child objects will always be copied (if the maxDepth allows)</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;89</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @return the cloned object</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;90</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     */</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;91</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    @SuppressWarnings(<span class="string">"unchecked"</span>)</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;92</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="keyword">public</span> &lt;T&gt; T deepClone(T object, <span class="keyword">int</span> maxDepth, String[] fieldNamesToSkip) {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;93</td>
  <td class="nbHitsCovered">&nbsp;11</td>
  <td class="src"><pre class="src">&nbsp;        Set&lt;String&gt; skip = ArrayUtils.makeSetFromArray(fieldNamesToSkip);</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;94</td>
  <td class="nbHitsCovered">&nbsp;11</td>
  <td class="src"><pre class="src">&nbsp;        T clone = (T) internalDeepClone(object, CopyDestination.ORIGINAL, maxDepth, skip, 0, <span class="keyword">true</span>, <span class="keyword">false</span>);</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;95</td>
  <td class="nbHitsCovered">&nbsp;11</td>
  <td class="src"><pre class="src">&nbsp;        <span class="keyword">return</span> clone;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;96</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    }</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;97</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;98</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="comment">/**</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;99</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * Deep copies one object into another, this is primarily for copying between identical types of objects but</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;100</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * it can also handle copying between objects which are quite different, </span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;101</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * this does not just do a reference copy of the values but actually creates new objects in the current classloader</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;102</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * </span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;103</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param orig the original object to copy from</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;104</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param dest the object to copy the values to (must have the same fields with the same types)</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;105</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param maxDepth the number of objects to follow when traveling through the object and copying</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;106</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * the values from it, 0 means to only copy the simple values in the object, any objects will</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;107</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * be ignored and will end up as nulls, 1 means to follow the first objects found and copy all</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;108</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * of their simple values as well, and so forth</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;109</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param fieldNamesToSkip (optional) the names of fields to skip while cloning this object,</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;110</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * this only has an effect on the bottom level of the object, any fields found</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;111</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * on child objects will always be copied (if the maxDepth allows)</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;112</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param ignoreNulls if true then nulls are not copied and the destination retains the value it has,</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;113</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * if false then nulls are copied and the destination value will become a null if the original value is a null</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;114</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @throws IllegalArgumentException if the copy cannot be completed because the objects to copy do not have matching fields or types</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;115</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     */</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;116</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="keyword">public</span> <span class="keyword">void</span> deepCopy(Object orig, Object dest, <span class="keyword">int</span> maxDepth, String[] fieldNamesToSkip, <span class="keyword">boolean</span> ignoreNulls) {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;117</td>
  <td class="nbHitsCovered">&nbsp;14</td>
  <td class="src"><pre class="src">&nbsp;        Set&lt;String&gt; skip = ArrayUtils.makeSetFromArray(fieldNamesToSkip);</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;118</td>
  <td class="nbHitsCovered">&nbsp;14</td>
  <td class="src"><pre class="src">&nbsp;        internalDeepCopy(orig, dest, maxDepth, skip, ignoreNulls, <span class="keyword">true</span>);</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;119</td>
  <td class="nbHitsCovered">&nbsp;10</td>
  <td class="src"><pre class="src">&nbsp;    }</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;120</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;121</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="comment">/**</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;122</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * This handles the copying of objects to maps, it is recursive and is a deep operation which</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;123</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * traverses the entire object and clones every part of it. When converting to a map this will ensure</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;124</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * that there are no objects which are not part of java.lang or java.util in the new map&lt;br/&gt;</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;125</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * NOTE: This can handle simple objects (non-maps and non-beans) but will have to make up the initial map key</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;126</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * in the returned map, "data" will be used as the key&lt;br/&gt;</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;127</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * NOTE: Nulls are allowed to pass through this method (i.e. passing in a null object results in a null output)</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;128</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * </span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;129</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param bean any java object</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;130</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param maxDepth the number of objects to follow when traveling through the object and copying</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;131</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * the values from it, 0 means to only copy the simple values in the object, any objects will</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;132</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * be ignored and will end up as nulls, 1 means to follow the first objects found and copy all</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;133</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * of their simple values as well, and so forth</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;134</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param fieldNamesToSkip (optional) the names of fields to skip while cloning this object,</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;135</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * this only has an effect on the bottom level of the object, any fields found</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;136</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * on child objects will always be copied (if the maxDepth allows)</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;137</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param ignoreNulls if true then nulls are not copied and the destination retains the value it has,</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;138</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * if false then nulls are copied and the destination value will become a null if the original value is a null</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;139</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param ignoreTransient if true then all transient fields will be skipped, useful when serializing</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;140</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param initialKey (optional) the initial key to use when simple objects are converted to maps, defaults to "data"</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;141</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @return the resulting map which contains the cloned data from the object</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;142</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     */</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;143</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    @SuppressWarnings(<span class="string">"unchecked"</span>)</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;144</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="keyword">public</span> Map&lt;String, Object&gt; deepMap(Object object, <span class="keyword">int</span> maxDepth, String[] fieldNamesToSkip, <span class="keyword">boolean</span> ignoreNulls, <span class="keyword">boolean</span> ignoreTransient, String initialKey) {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;145</td>
  <td class="nbHitsCovered">&nbsp;18</td>
  <td class="src"><pre class="src">&nbsp;        Set&lt;String&gt; skip = ArrayUtils.makeSetFromArray(fieldNamesToSkip);</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;146</td>
  <td class="nbHitsCovered">&nbsp;18</td>
  <td class="src"><pre class="src">&nbsp;        Object clone = internalDeepClone(object, CopyDestination.MAP, maxDepth, skip, 0, ignoreNulls, ignoreTransient);</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;147</td>
  <td class="nbHitsCovered">&nbsp;18</td>
  <td class="src"><pre class="src">&nbsp;        Map&lt;String, Object&gt; map = <span class="keyword">null</span>;</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;148</td>
  <td class="nbHitsCovered">&nbsp;18</td>
  <td class="src"><pre class="src">&nbsp;        <span class="keyword">if</span> (clone != <span class="keyword">null</span>) {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;149</td>
  <td class="nbHitsCovered">&nbsp;18</td>
  <td class="src"><pre class="src">&nbsp;            <span class="keyword">if</span> ( ConstructorUtils.isClassMap(clone.getClass())) {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;150</td>
  <td class="nbHitsCovered">&nbsp;12</td>
  <td class="src"><pre class="src">&nbsp;                map = (Map&lt;String, Object&gt;) clone;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;151</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;            } <span class="keyword">else</span> {</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;152</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                <span class="comment">// handle the case of non-map/bean by wrapping in a map</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;153</td>
  <td class="nbHitsCovered">&nbsp;6</td>
  <td class="src"><pre class="src">&nbsp;                <span class="keyword">if</span> (initialKey == <span class="keyword">null</span>) {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;154</td>
  <td class="nbHitsCovered">&nbsp;6</td>
  <td class="src"><pre class="src">&nbsp;                    initialKey = <span class="string">"data"</span>;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;155</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                }</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;156</td>
  <td class="nbHitsCovered">&nbsp;6</td>
  <td class="src"><pre class="src">&nbsp;                map = <span class="keyword">new</span> HashMap&lt;String, Object&gt;();</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;157</td>
  <td class="nbHitsCovered">&nbsp;6</td>
  <td class="src"><pre class="src">&nbsp;                map.put(initialKey, clone);</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;158</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;            }</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;159</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        }</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;160</td>
  <td class="nbHitsCovered">&nbsp;18</td>
  <td class="src"><pre class="src">&nbsp;        <span class="keyword">return</span> map;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;161</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    }</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;162</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;163</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="comment">/**</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;164</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * Populates an object with the values in the properties map,</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;165</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * this will not fail if the fieldName in the map is not a property on the</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;166</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * object or the fieldName cannot be written to with the value in the object.</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;167</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * This will attempt to convert the provided object values into the right values</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;168</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * to place in the object&lt;br/&gt;</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;169</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * &lt;b&gt;NOTE:&lt;/b&gt; simple types like numbers and strings can almost always be converted from</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;170</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * just about anything though they will probably end up as 0 or ""&lt;br/&gt;</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;171</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * Setting fields supports simple, nested, indexed, and mapped values:&lt;br/&gt;</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;172</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * &lt;b&gt;Simple:&lt;/b&gt; Get/set a field in a bean (or map), Example: "title", "id"&lt;br/&gt;</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;173</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * &lt;b&gt;Nested:&lt;/b&gt; Get/set a field in a bean which is contained in another bean, Example: "someBean.title", "someBean.id"&lt;br/&gt;</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;174</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * &lt;b&gt;Indexed:&lt;/b&gt; Get/set a list/array item by index in a bean, Example: "myList[1]", "anArray[2]"&lt;br/&gt;</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;175</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * &lt;b&gt;Mapped:&lt;/b&gt; Get/set a map entry by key in a bean, Example: "myMap(key)", "someMap(thing)"&lt;br/&gt;</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;176</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * </span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;177</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param object any object</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;178</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param properties a map of fieldNames -&gt; Object</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;179</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @return the list of fieldNames which were successfully written to the object</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;180</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @throws IllegalArgumentException if the arguments are invalid</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;181</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     */</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;182</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="keyword">public</span> List&lt;String&gt; populate(Object object, Map&lt;String, Object&gt; properties) {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;183</td>
  <td class="nbHitsCovered">&nbsp;16</td>
  <td class="src"><pre class="src">&nbsp;        <span class="keyword">if</span> (object == <span class="keyword">null</span> || properties == <span class="keyword">null</span>) {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;184</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;            <span class="keyword">throw</span> <span class="keyword">new</span> IllegalArgumentException(<span class="string">"object and properties cannot be null"</span>);</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;185</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        }</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;186</td>
  <td class="nbHitsCovered">&nbsp;16</td>
  <td class="src"><pre class="src">&nbsp;        Map&lt;String, Class&lt;?&gt;&gt; fieldTypes = getFieldUtils().getFieldTypes(object.getClass(), FieldsFilter.ALL);</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;187</td>
  <td class="nbHitsCovered">&nbsp;16</td>
  <td class="src"><pre class="src">&nbsp;        List&lt;String&gt; writtenFields = <span class="keyword">new</span> ArrayList&lt;String&gt;();</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;188</td>
  <td class="nbHitsCovered">&nbsp;16</td>
  <td class="src"><pre class="src">&nbsp;        <span class="keyword">for</span> (Entry&lt;String, Object&gt; entry : properties.entrySet()) {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;189</td>
  <td class="nbHitsCovered">&nbsp;50</td>
  <td class="src"><pre class="src">&nbsp;            String fieldName = entry.getKey();</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;190</td>
  <td class="nbHitsCovered">&nbsp;50</td>
  <td class="src"><pre class="src">&nbsp;            <span class="keyword">if</span> (fieldName != <span class="keyword">null</span> &amp;&amp; ! <span class="string">""</span>.equals(fieldName)) {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;191</td>
  <td class="nbHitsCovered">&nbsp;50</td>
  <td class="src"><pre class="src">&nbsp;                Class&lt;?&gt; targetType = fieldTypes.get(fieldName);</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;192</td>
  <td class="nbHitsCovered">&nbsp;50</td>
  <td class="src"><pre class="src">&nbsp;                <span class="keyword">if</span> (targetType != <span class="keyword">null</span>) {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;193</td>
  <td class="nbHitsCovered">&nbsp;29</td>
  <td class="src"><pre class="src">&nbsp;                    Object value = entry.getValue();</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;194</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                    <span class="keyword">try</span> {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;195</td>
  <td class="nbHitsCovered">&nbsp;29</td>
  <td class="src"><pre class="src">&nbsp;                        <span class="keyword">if</span> ( ConstructorUtils.isClassSimple(targetType) ) {</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;196</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                            <span class="comment">// this should write the value or fail</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;197</td>
  <td class="nbHitsCovered">&nbsp;21</td>
  <td class="src"><pre class="src">&nbsp;                            getFieldUtils().setFieldValue(object, fieldName, value, <span class="keyword">true</span>);</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;198</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                        } <span class="keyword">else</span> {</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;199</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                            <span class="comment">// value is a bean so we will dig into it further</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;200</td>
  <td class="nbHitsCovered">&nbsp;8</td>
  <td class="src"><pre class="src">&nbsp;                            Object dest = getFieldUtils().getFieldValue(object, fieldName);</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;201</td>
  <td class="nbHitsCovered">&nbsp;8</td>
  <td class="src"><pre class="src">&nbsp;                            <span class="keyword">if</span> (dest == <span class="keyword">null</span>) {</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;202</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                                <span class="comment">// need to construct the destination</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;203</td>
  <td class="nbHitsCovered">&nbsp;4</td>
  <td class="src"><pre class="src">&nbsp;                                <span class="keyword">if</span> (value.getClass().isArray() &amp;&amp; targetType.isArray()) {</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;204</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                                    <span class="comment">// special case for array to array since the destination must match</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;205</td>
  <td class="nbHitsCovered">&nbsp;1</td>
  <td class="src"><pre class="src">&nbsp;                                    dest = ArrayUtils.template((Object[])value);</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;206</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                                } <span class="keyword">else</span> {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;207</td>
  <td class="nbHitsCovered">&nbsp;3</td>
  <td class="src"><pre class="src">&nbsp;                                    dest = getConstructorUtils().constructClass(targetType);</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;208</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                                }</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;209</td>
  <td class="nbHitsCovered">&nbsp;4</td>
  <td class="src"><pre class="src">&nbsp;                                getFieldUtils().setFieldValue(object, fieldName, dest, <span class="keyword">true</span>);</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;210</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                            }</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;211</td>
  <td class="nbHitsCovered">&nbsp;8</td>
  <td class="src"><pre class="src">&nbsp;                            internalDeepCopy(value, dest, 5, <span class="keyword">null</span>, <span class="keyword">false</span>, <span class="keyword">true</span>);</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;212</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                        }</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;213</td>
  <td class="nbHitsCovered">&nbsp;29</td>
  <td class="src"><pre class="src">&nbsp;                        writtenFields.add(fieldName); <span class="comment">// record that the value was written successfully</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;214</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;                    } <span class="keyword">catch</span> (RuntimeException e) {</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;215</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                        <span class="comment">// this is OK, it just means we did not write the value</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;216</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;                        <span class="keyword">continue</span>;</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;217</td>
  <td class="nbHitsCovered">&nbsp;29</td>
  <td class="src"><pre class="src">&nbsp;                    }</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;218</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                }</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;219</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;            }</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;220</td>
  <td class="nbHitsCovered">&nbsp;50</td>
  <td class="src"><pre class="src">&nbsp;        }</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;221</td>
  <td class="nbHitsCovered">&nbsp;16</td>
  <td class="src"><pre class="src">&nbsp;        <span class="keyword">return</span> writtenFields;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;222</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    }</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;223</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;224</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="comment">/**</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;225</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * Populates an object with the String array values in the params map,</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;226</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * this will not fail if the fieldName in the map is not a property on the</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;227</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * object or the fieldName cannot be written to with the value in the object&lt;br/&gt;</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;228</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * Arrays which are length 1 will be converted to a string before they are set on the target field &lt;br/&gt;</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;229</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * Setting fields supports simple, nested, indexed, and mapped values:&lt;br/&gt;</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;230</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * &lt;b&gt;Simple:&lt;/b&gt; Get/set a field in a bean (or map), Example: "title", "id"&lt;br/&gt;</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;231</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * &lt;b&gt;Nested:&lt;/b&gt; Get/set a field in a bean which is contained in another bean, Example: "someBean.title", "someBean.id"&lt;br/&gt;</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;232</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * &lt;b&gt;Indexed:&lt;/b&gt; Get/set a list/array item by index in a bean, Example: "myList[1]", "anArray[2]"&lt;br/&gt;</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;233</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * &lt;b&gt;Mapped:&lt;/b&gt; Get/set a map entry by key in a bean, Example: "myMap(key)", "someMap(thing)"&lt;br/&gt;</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;234</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * </span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;235</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param object any object</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;236</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param params a map of fieldNames -&gt; String[] (normally from an http request)</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;237</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @return the list of fieldNames which were successfully written to the object</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;238</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @throws IllegalArgumentException if the arguments are invalid</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;239</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     */</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;240</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="keyword">public</span> List&lt;String&gt; populateFromParams(Object object, Map&lt;String, String[]&gt; params) {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;241</td>
  <td class="nbHitsCovered">&nbsp;4</td>
  <td class="src"><pre class="src">&nbsp;        <span class="keyword">if</span> (object == <span class="keyword">null</span> || params == <span class="keyword">null</span>) {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;242</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;            <span class="keyword">throw</span> <span class="keyword">new</span> IllegalArgumentException(<span class="string">"object and params cannot be null"</span>);</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;243</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        }</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;244</td>
  <td class="nbHitsCovered">&nbsp;4</td>
  <td class="src"><pre class="src">&nbsp;        List&lt;String&gt; writtenFields = <span class="keyword">new</span> ArrayList&lt;String&gt;();</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;245</td>
  <td class="nbHitsCovered">&nbsp;4</td>
  <td class="src"><pre class="src">&nbsp;        <span class="keyword">for</span> (Entry&lt;String, String[]&gt; entry : params.entrySet()) {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;246</td>
  <td class="nbHitsCovered">&nbsp;14</td>
  <td class="src"><pre class="src">&nbsp;            String fieldName = entry.getKey();</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;247</td>
  <td class="nbHitsCovered">&nbsp;14</td>
  <td class="src"><pre class="src">&nbsp;            <span class="keyword">if</span> (fieldName != <span class="keyword">null</span> &amp;&amp; ! <span class="string">""</span>.equals(fieldName)) {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;248</td>
  <td class="nbHitsCovered">&nbsp;14</td>
  <td class="src"><pre class="src">&nbsp;                String[] value = entry.getValue();</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;249</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                <span class="keyword">try</span> {</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;250</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                    <span class="comment">// this should write the value or fail</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;251</td>
  <td class="nbHitsCovered">&nbsp;14</td>
  <td class="src"><pre class="src">&nbsp;                    <span class="keyword">if</span> (value != <span class="keyword">null</span>) {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;252</td>
  <td class="nbHitsCovered">&nbsp;14</td>
  <td class="src"><pre class="src">&nbsp;                        Object toSet = value;</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;253</td>
  <td class="nbHitsCovered">&nbsp;14</td>
  <td class="src"><pre class="src">&nbsp;                        <span class="keyword">if</span> (value.length == 0) {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;254</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;                            toSet = <span class="string">""</span>;</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;255</td>
  <td class="nbHitsCovered">&nbsp;14</td>
  <td class="src"><pre class="src">&nbsp;                        } <span class="keyword">else</span> <span class="keyword">if</span> (value.length == 1) {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;256</td>
  <td class="nbHitsCovered">&nbsp;12</td>
  <td class="src"><pre class="src">&nbsp;                            toSet = value[0];</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;257</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                        }</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;258</td>
  <td class="nbHitsCovered">&nbsp;14</td>
  <td class="src"><pre class="src">&nbsp;                        getFieldUtils().setFieldValue(object, fieldName, toSet, <span class="keyword">true</span>);</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;259</td>
  <td class="nbHitsCovered">&nbsp;14</td>
  <td class="src"><pre class="src">&nbsp;                        writtenFields.add(fieldName); <span class="comment">// record that the value was written successfully</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;260</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                    }</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;261</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;                } <span class="keyword">catch</span> (RuntimeException e) {</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;262</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                    <span class="comment">// this is OK, it just means we did not write the value</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;263</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;                    <span class="keyword">continue</span>;</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;264</td>
  <td class="nbHitsCovered">&nbsp;14</td>
  <td class="src"><pre class="src">&nbsp;                }</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;265</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;            }</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;266</td>
  <td class="nbHitsCovered">&nbsp;14</td>
  <td class="src"><pre class="src">&nbsp;        }</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;267</td>
  <td class="nbHitsCovered">&nbsp;4</td>
  <td class="src"><pre class="src">&nbsp;        <span class="keyword">return</span> writtenFields;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;268</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    }</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;269</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;270</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;271</td>
  <td class="nbHitsCovered">&nbsp;3</td>
  <td class="src"><pre class="src">&nbsp;    <span class="keyword">public</span> <span class="keyword">static</span> enum CopyDestination {ORIGINAL, MAP};</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;272</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="comment">/**</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;273</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * This handles the cloning of objects to objects or maps, it is recursive and is a deep operation which</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;274</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * traverses the entire object and clones every part of it, when converting to a map this will ensure</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;275</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * that there are no objects which are not part of java.lang or java.util in the new map</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;276</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param bean any java object</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;277</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param dest the type of destination: ORIGINAL = an object of type matching bean, MAP = an ordered map</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;278</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param maxDepth the number of objects to follow when traveling through the object and copying</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;279</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * the values from it, 0 means to only copy the simple values in the object, any objects will</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;280</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * be ignored and will end up as nulls, 1 means to follow the first objects found and copy all</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;281</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * of their simple values as well, and so forth</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;282</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param fieldNamesToSkip the names of fields to skip while cloning this object,</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;283</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * this only has an effect on the bottom level of the object, any fields found</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;284</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * on child objects will always be copied (if the maxDepth allows)</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;285</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param currentDepth the current depth for recursion and halting when appropriate depth is reached</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;286</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param ignoreNulls if true then nulls are not copied and the destination retains the value it has,</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;287</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * if false then nulls are copied and the destination value will become a null if the original value is a null</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;288</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param ignoreTransient if true then all transient fields will be skipped, useful when serializing</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;289</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @return the object or map which has been cloned</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;290</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     */</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;291</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    @SuppressWarnings(<span class="string">"unchecked"</span>)</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;292</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="keyword">protected</span> Object internalDeepClone(Object bean, CopyDestination dest, <span class="keyword">int</span> maxDepth, Set&lt;String&gt; fieldNamesToSkip, <span class="keyword">int</span> currentDepth, <span class="keyword">boolean</span> ignoreNulls, <span class="keyword">boolean</span> ignoreTransient) {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;293</td>
  <td class="nbHitsCovered">&nbsp;274</td>
  <td class="src"><pre class="src">&nbsp;        Object copy = <span class="keyword">null</span>;</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;294</td>
  <td class="nbHitsCovered">&nbsp;274</td>
  <td class="src"><pre class="src">&nbsp;        <span class="keyword">if</span> ( bean != <span class="keyword">null</span> ) {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;295</td>
  <td class="nbHitsCovered">&nbsp;254</td>
  <td class="src"><pre class="src">&nbsp;            Class&lt;?&gt; beanClass = bean.getClass();</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;296</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;            <span class="comment">// always copy the simple types if possible</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;297</td>
  <td class="nbHitsCovered">&nbsp;254</td>
  <td class="src"><pre class="src">&nbsp;            <span class="keyword">if</span> (ConstructorUtils.isClassSimple(beanClass)) {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;298</td>
  <td class="nbHitsCovered">&nbsp;188</td>
  <td class="src"><pre class="src">&nbsp;                copy = bean;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;299</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;            } <span class="keyword">else</span> {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;300</td>
  <td class="nbHitsCovered">&nbsp;66</td>
  <td class="src"><pre class="src">&nbsp;                <span class="keyword">if</span> (currentDepth &lt;= maxDepth) {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;301</td>
  <td class="nbHitsCovered">&nbsp;66</td>
  <td class="src"><pre class="src">&nbsp;                    currentDepth++;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;302</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                    <span class="keyword">try</span> {</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;303</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                        <span class="comment">// now do the cloning based on the thing to clone</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;304</td>
  <td class="nbHitsCovered">&nbsp;66</td>
  <td class="src"><pre class="src">&nbsp;                        <span class="keyword">if</span> (beanClass.isArray()) {</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;305</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                            <span class="comment">// special case, use array reflection</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;306</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                            <span class="comment">// make new array</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;307</td>
  <td class="nbHitsCovered">&nbsp;16</td>
  <td class="src"><pre class="src">&nbsp;                            <span class="keyword">int</span> length = ArrayUtils.size((Object[]) bean);</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;308</td>
  <td class="nbHitsCovered">&nbsp;16</td>
  <td class="src"><pre class="src">&nbsp;                            Class&lt;?&gt; componentType = beanClass.getComponentType();</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;309</td>
  <td class="nbHitsCovered">&nbsp;16</td>
  <td class="src"><pre class="src">&nbsp;                            <span class="keyword">if</span> ( ConstructorUtils.isClassBean(componentType) </pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;310</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                                    &amp;&amp; CopyDestination.MAP.equals(dest)) {</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;311</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                                <span class="comment">// special array component type for arrays of objects when map converting</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;312</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;                                componentType = ArrayOrderedMap.<span class="keyword">class</span>;</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;313</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                            }</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;314</td>
  <td class="nbHitsCovered">&nbsp;16</td>
  <td class="src"><pre class="src">&nbsp;                            copy = ArrayUtils.create(componentType, length);</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;315</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                            <span class="comment">// now copy the stuff into it</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;316</td>
  <td class="nbHitsCovered">&nbsp;50</td>
  <td class="src"><pre class="src">&nbsp;                            <span class="keyword">for</span> (<span class="keyword">int</span> i = 0; i &lt; length; i++) {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;317</td>
  <td class="nbHitsCovered">&nbsp;34</td>
  <td class="src"><pre class="src">&nbsp;                                Object value = Array.get(bean, i);</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;318</td>
  <td class="nbHitsCovered">&nbsp;34</td>
  <td class="src"><pre class="src">&nbsp;                                Object clone = internalDeepClone(value, dest, maxDepth, <span class="keyword">null</span>, currentDepth, ignoreNulls, ignoreTransient);</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;319</td>
  <td class="nbHitsCovered">&nbsp;34</td>
  <td class="src"><pre class="src">&nbsp;                                Array.set(copy, i, clone);</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;320</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                            }</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;321</td>
  <td class="nbHitsCovered">&nbsp;16</td>
  <td class="src"><pre class="src">&nbsp;                        } <span class="keyword">else</span> <span class="keyword">if</span> (Collection.<span class="keyword">class</span>.isAssignableFrom(beanClass)) {</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;322</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                            <span class="comment">// special case, clone everything in the list</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;323</td>
  <td class="nbHitsCovered">&nbsp;11</td>
  <td class="src"><pre class="src">&nbsp;                            copy = getConstructorUtils().constructClass(beanClass); <span class="comment">// make new list</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;324</td>
  <td class="nbHitsCovered">&nbsp;11</td>
  <td class="src"><pre class="src">&nbsp;                            <span class="keyword">for</span> (Object element : (Collection) bean) {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;325</td>
  <td class="nbHitsCovered">&nbsp;26</td>
  <td class="src"><pre class="src">&nbsp;                                Object clone = internalDeepClone(element, dest, maxDepth, <span class="keyword">null</span>, currentDepth, ignoreNulls, ignoreTransient);</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;326</td>
  <td class="nbHitsCovered">&nbsp;26</td>
  <td class="src"><pre class="src">&nbsp;                                ((Collection) copy).add( clone );</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;327</td>
  <td class="nbHitsCovered">&nbsp;26</td>
  <td class="src"><pre class="src">&nbsp;                            }</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;328</td>
  <td class="nbHitsCovered">&nbsp;39</td>
  <td class="src"><pre class="src">&nbsp;                        } <span class="keyword">else</span> <span class="keyword">if</span> (Map.<span class="keyword">class</span>.isAssignableFrom(beanClass)) {</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;329</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                            <span class="comment">// special case, clone everything in the map except keys</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;330</td>
  <td class="nbHitsCovered">&nbsp;11</td>
  <td class="src"><pre class="src">&nbsp;                            copy = getConstructorUtils().constructClass(beanClass); <span class="comment">// make new map</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;331</td>
  <td class="nbHitsCovered">&nbsp;11</td>
  <td class="src"><pre class="src">&nbsp;                            <span class="keyword">for</span> (Object key : ((Map) bean).keySet()) {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;332</td>
  <td class="nbHitsCovered">&nbsp;26</td>
  <td class="src"><pre class="src">&nbsp;                                <span class="keyword">if</span> ( fieldNamesToSkip != <span class="keyword">null</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;333</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                                        &amp;&amp; fieldNamesToSkip.contains(key) ) {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;334</td>
  <td class="nbHitsCovered">&nbsp;2</td>
  <td class="src"><pre class="src">&nbsp;                                    <span class="keyword">continue</span>; <span class="comment">// skip to next</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;335</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                                }</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;336</td>
  <td class="nbHitsCovered">&nbsp;24</td>
  <td class="src"><pre class="src">&nbsp;                                Object value = ((Map) bean).get(key);</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;337</td>
  <td class="nbHitsCovered">&nbsp;24</td>
  <td class="src"><pre class="src">&nbsp;                                <span class="keyword">if</span> (value == <span class="keyword">null</span> &amp;&amp; ignoreNulls) {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;338</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;                                    <span class="keyword">continue</span>;</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;339</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                                }</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;340</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                                <span class="keyword">try</span> {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;341</td>
  <td class="nbHitsCovered">&nbsp;24</td>
  <td class="src"><pre class="src">&nbsp;                                    ((Map) copy).put(key, </pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;342</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                                            internalDeepClone(value, dest, maxDepth, <span class="keyword">null</span>, currentDepth, ignoreNulls, ignoreTransient) );</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;343</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;                                } <span class="keyword">catch</span> (NullPointerException e) {</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;344</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                                    <span class="comment">// map does not support nulls so skip and keep going</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;345</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;                                    <span class="keyword">continue</span>;</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;346</td>
  <td class="nbHitsCovered">&nbsp;24</td>
  <td class="src"><pre class="src">&nbsp;                                }                     </pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;347</td>
  <td class="nbHitsCovered">&nbsp;24</td>
  <td class="src"><pre class="src">&nbsp;                            }</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;348</td>
  <td class="nbHitsCovered">&nbsp;28</td>
  <td class="src"><pre class="src">&nbsp;                        } <span class="keyword">else</span> <span class="keyword">if</span> (getFieldAdapter().isAdaptableClass(beanClass)) {</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;349</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                            <span class="comment">// special handling for dynabeans</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;350</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;                            <span class="keyword">if</span> (CopyDestination.MAP.equals(dest)) {</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;351</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;                                copy = <span class="keyword">new</span> ArrayOrderedMap&lt;String, Object&gt;();</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;352</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                            } <span class="keyword">else</span> {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;353</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;                                copy = getFieldAdapter().newInstance(bean); <span class="comment">// make new dynabean</span></span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;354</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                            }</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;355</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;                            List&lt;String&gt; propertyNames = getFieldAdapter().getPropertyNames(bean);</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;356</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;                            <span class="keyword">for</span> (String name : propertyNames) {</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;357</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;                                <span class="keyword">if</span> ( fieldNamesToSkip != <span class="keyword">null</span></span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;358</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                                        &amp;&amp; fieldNamesToSkip.contains(name) ) {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;359</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;                                    <span class="keyword">continue</span>; <span class="comment">// skip to next</span></span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;360</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                                }</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;361</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                                <span class="keyword">try</span> {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;362</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;                                    Object value = getFieldAdapter().getSimpleValue(bean, name);</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;363</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;                                    <span class="keyword">if</span> (value == <span class="keyword">null</span> &amp;&amp; ignoreNulls) {</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;364</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;                                        <span class="keyword">continue</span>;</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;365</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                                    }</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;366</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;                                    <span class="keyword">if</span> (CopyDestination.MAP.equals(dest)) {</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;367</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;                                        ((Map&lt;String, Object&gt;) copy).put(name, </span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;368</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                                                internalDeepClone(value, dest, maxDepth, <span class="keyword">null</span>, currentDepth, ignoreNulls, ignoreTransient) );</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;369</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                                    } <span class="keyword">else</span> {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;370</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;                                        getFieldUtils().setFieldValue(copy, name, </span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;371</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                                                internalDeepClone(value, dest, maxDepth, <span class="keyword">null</span>, currentDepth, ignoreNulls, ignoreTransient) );</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;372</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                                    }</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;373</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;                                } <span class="keyword">catch</span> (IllegalArgumentException e) {</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;374</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                                    <span class="comment">// this is ok, field might not be readable so we will not clone it, continue on</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;375</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;                                }</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;376</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                            }</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;377</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;                        } <span class="keyword">else</span> {</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;378</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                            <span class="comment">// regular javabean</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;379</td>
  <td class="nbHitsCovered">&nbsp;28</td>
  <td class="src"><pre class="src">&nbsp;                            FieldsFilter filter = FieldsFilter.COMPLETE;</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;380</td>
  <td class="nbHitsCovered">&nbsp;28</td>
  <td class="src"><pre class="src">&nbsp;                            <span class="keyword">if</span> (CopyDestination.MAP.equals(dest)) {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;381</td>
  <td class="nbHitsCovered">&nbsp;18</td>
  <td class="src"><pre class="src">&nbsp;                                copy = <span class="keyword">new</span> ArrayOrderedMap&lt;String, Object&gt;();</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;382</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                                <span class="comment">// maps should pick up all readable fields</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;383</td>
  <td class="nbHitsCovered">&nbsp;18</td>
  <td class="src"><pre class="src">&nbsp;                                <span class="keyword">if</span> (ignoreTransient) {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;384</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;                                    filter = FieldsFilter.SERIALIZABLE;</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;385</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                                } <span class="keyword">else</span> {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;386</td>
  <td class="nbHitsCovered">&nbsp;18</td>
  <td class="src"><pre class="src">&nbsp;                                    filter = FieldsFilter.READABLE;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;387</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                                }</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;388</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                            } <span class="keyword">else</span> {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;389</td>
  <td class="nbHitsCovered">&nbsp;10</td>
  <td class="src"><pre class="src">&nbsp;                                copy = getConstructorUtils().constructClass(beanClass); <span class="comment">// make new bean</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;390</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                            }</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;391</td>
  <td class="nbHitsCovered">&nbsp;28</td>
  <td class="src"><pre class="src">&nbsp;                            ClassFields&lt;?&gt; cf = getFieldUtils().analyzeClass(beanClass);</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;392</td>
  <td class="nbHitsCovered">&nbsp;28</td>
  <td class="src"><pre class="src">&nbsp;                            Map&lt;String, Class&lt;?&gt;&gt; types = cf.getFieldTypes(filter);</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;393</td>
  <td class="nbHitsCovered">&nbsp;28</td>
  <td class="src"><pre class="src">&nbsp;                            <span class="keyword">for</span> (String name : types.keySet()) {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;394</td>
  <td class="nbHitsCovered">&nbsp;132</td>
  <td class="src"><pre class="src">&nbsp;                                <span class="keyword">if</span> (ClassFields.FIELD_CLASS.equals(name)) {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;395</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;                                    <span class="keyword">continue</span>; <span class="comment">// No point in trying to set/get an object's class</span></span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;396</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                                }</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;397</td>
  <td class="nbHitsCovered">&nbsp;132</td>
  <td class="src"><pre class="src">&nbsp;                                <span class="keyword">if</span> ( fieldNamesToSkip != <span class="keyword">null</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;398</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                                        &amp;&amp; fieldNamesToSkip.contains(name) ) {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;399</td>
  <td class="nbHitsCovered">&nbsp;2</td>
  <td class="src"><pre class="src">&nbsp;                                    <span class="keyword">continue</span>; <span class="comment">// skip to next</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;400</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                                }</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;401</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                                <span class="keyword">try</span> {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;402</td>
  <td class="nbHitsCovered">&nbsp;130</td>
  <td class="src"><pre class="src">&nbsp;                                    Object value = getFieldUtils().getFieldValue(bean, name);</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;403</td>
  <td class="nbHitsCovered">&nbsp;130</td>
  <td class="src"><pre class="src">&nbsp;                                    <span class="keyword">if</span> (value == <span class="keyword">null</span> &amp;&amp; ignoreNulls) {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;404</td>
  <td class="nbHitsCovered">&nbsp;15</td>
  <td class="src"><pre class="src">&nbsp;                                        <span class="keyword">continue</span>;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;405</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                                    }</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;406</td>
  <td class="nbHitsCovered">&nbsp;115</td>
  <td class="src"><pre class="src">&nbsp;                                    <span class="keyword">if</span> (CopyDestination.MAP.equals(dest)) {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;407</td>
  <td class="nbHitsCovered">&nbsp;92</td>
  <td class="src"><pre class="src">&nbsp;                                        ((Map&lt;String, Object&gt;) copy).put(name, </pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;408</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                                                internalDeepClone(value, dest, maxDepth, <span class="keyword">null</span>, currentDepth, ignoreNulls, ignoreTransient) );                     </pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;409</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                                    } <span class="keyword">else</span> {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;410</td>
  <td class="nbHitsCovered">&nbsp;23</td>
  <td class="src"><pre class="src">&nbsp;                                        getFieldUtils().setFieldValue(copy, name, </pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;411</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                                                internalDeepClone(value, dest, maxDepth, <span class="keyword">null</span>, currentDepth, ignoreNulls, ignoreTransient) );</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;412</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                                    }</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;413</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;                                } <span class="keyword">catch</span> (FieldnameNotFoundException e) {</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;414</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                                    <span class="comment">// this is ok, field might not exist or might not be readable so we skip it</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;415</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;                                } <span class="keyword">catch</span> (FieldGetValueException e) {</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;416</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                                    <span class="comment">// this is ok, field might not be readable (it should be though)</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;417</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;                                } <span class="keyword">catch</span> (FieldSetValueException e) {</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;418</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                                    <span class="comment">// this is ok, field might not be writeable (should also not happen)</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;419</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;                                } <span class="keyword">catch</span> (IllegalArgumentException e) {</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;420</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                                    <span class="comment">// this is ok, failure should not stop the clone</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;421</td>
  <td class="nbHitsCovered">&nbsp;230</td>
  <td class="src"><pre class="src">&nbsp;                                }</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;422</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                            }</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;423</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                        }</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;424</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;                    } <span class="keyword">catch</span> (Exception e) {</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;425</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                        <span class="comment">// catch any possible thrown exception and translate (this is not a mistake so ignore findbugs)</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;426</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;                        <span class="keyword">throw</span> <span class="keyword">new</span> RuntimeException(<span class="string">"Failure during deep cloning ("</span>+beanClass+<span class="string">") maxDepth="</span>+maxDepth+<span class="string">", currentDepth="</span>+currentDepth+<span class="string">": "</span> + e.getMessage(), e);</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;427</td>
  <td class="nbHitsCovered">&nbsp;66</td>
  <td class="src"><pre class="src">&nbsp;                    }</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;428</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                }</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;429</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;            }</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;430</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        }</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;431</td>
  <td class="nbHitsCovered">&nbsp;274</td>
  <td class="src"><pre class="src">&nbsp;        <span class="keyword">return</span> copy;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;432</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    }</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;433</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;434</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="comment">/**</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;435</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param orig the original object to copy from</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;436</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param dest the object to copy the values to (must have the same fields with the same types)</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;437</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param maxDepth the number of objects to follow when traveling through the object and copying</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;438</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * the values from it, 0 means to only copy the simple values in the object, any objects will</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;439</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * be ignored and will end up as nulls, 1 means to follow the first objects found and copy all</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;440</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * of their simple values as well, and so forth</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;441</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param fieldNamesToSkip the names of fields to skip while cloning this object,</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;442</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * this only has an effect on the bottom level of the object, any fields found</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;443</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * on child objects will always be copied (if the maxDepth allows)</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;444</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param ignoreNulls if true then nulls are not copied and the destination retains the value it has,</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;445</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * if false then nulls are copied and the destination value will become a null if the original value is a null</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;446</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param autoConvert if true the the original will be converted to the dest type if needed</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;447</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @throws IllegalArgumentException if the copy cannot be completed because the objects to copy do not have matching fields or types</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;448</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     */</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;449</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    @SuppressWarnings(<span class="string">"unchecked"</span>)</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;450</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="keyword">protected</span> <span class="keyword">void</span> internalDeepCopy(Object orig, Object dest, <span class="keyword">int</span> maxDepth, Set&lt;String&gt; fieldNamesToSkip, <span class="keyword">boolean</span> ignoreNulls, <span class="keyword">boolean</span> autoConvert) {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;451</td>
  <td class="nbHitsCovered">&nbsp;22</td>
  <td class="src"><pre class="src">&nbsp;        <span class="keyword">if</span> (orig == <span class="keyword">null</span> || dest == <span class="keyword">null</span>) {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;452</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;            <span class="keyword">throw</span> <span class="keyword">new</span> IllegalArgumentException(<span class="string">"original object and destination object must not be null, if you want to clone the object then use the clone method"</span>);</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;453</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        }</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;454</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;455</td>
  <td class="nbHitsCovered">&nbsp;22</td>
  <td class="src"><pre class="src">&nbsp;        <span class="keyword">int</span> currentDepth = 1;</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;456</td>
  <td class="nbHitsCovered">&nbsp;22</td>
  <td class="src"><pre class="src">&nbsp;        Class&lt;?&gt; origClass = orig.getClass();</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;457</td>
  <td class="nbHitsCovered">&nbsp;22</td>
  <td class="src"><pre class="src">&nbsp;        Class&lt;?&gt; destClass = dest.getClass();</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;458</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;459</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        <span class="comment">// check if copy is possible first</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;460</td>
  <td class="nbHitsCovered">&nbsp;22</td>
  <td class="src"><pre class="src">&nbsp;        <span class="keyword">if</span> (ConstructorUtils.getImmutableTypes().contains(destClass)) {</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;461</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;            <span class="comment">// cannot copy to an immutable object</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;462</td>
  <td class="nbHitsCovered">&nbsp;4</td>
  <td class="src"><pre class="src">&nbsp;            <span class="keyword">throw</span> <span class="keyword">new</span> IllegalArgumentException(<span class="string">"Cannot copy to an immutable object"</span>);</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;463</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        }</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;464</td>
  <td class="nbHitsCovered">&nbsp;18</td>
  <td class="src"><pre class="src">&nbsp;        <span class="keyword">if</span> (autoConvert &amp;&amp; ! ConstructorUtils.isClassBean(origClass) ) {</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;465</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;            <span class="comment">// attempt to convert non-beans into the type we are copying to, fail if it does not work</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;466</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;            <span class="comment">// This has to be done because the copy will simply fail if we try to copy between non-beans which are not equivalent</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;467</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;            <span class="keyword">try</span> {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;468</td>
  <td class="nbHitsCovered">&nbsp;12</td>
  <td class="src"><pre class="src">&nbsp;                orig = getConversionUtils().convert(orig, destClass);</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;469</td>
  <td class="nbHitsCovered">&nbsp;12</td>
  <td class="src"><pre class="src">&nbsp;                origClass = destClass;</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;470</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;            } <span class="keyword">catch</span> (UnsupportedOperationException e) {</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;471</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;                <span class="keyword">throw</span> <span class="keyword">new</span> IllegalArgumentException(<span class="string">"Cannot copy from an immutable object to a complex object without converter support"</span>);</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;472</td>
  <td class="nbHitsCovered">&nbsp;12</td>
  <td class="src"><pre class="src">&nbsp;            }</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;473</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        }</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;474</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        <span class="comment">// copy orig to dest</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;475</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        <span class="keyword">try</span> {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;476</td>
  <td class="nbHitsCovered">&nbsp;18</td>
  <td class="src"><pre class="src">&nbsp;            <span class="keyword">if</span> (origClass.isArray()) {</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;477</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                <span class="comment">// special case, copy and overwrite existing array values</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;478</td>
  <td class="nbHitsCovered">&nbsp;6</td>
  <td class="src"><pre class="src">&nbsp;                <span class="keyword">if</span> (destClass.isArray()) {</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;479</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                    <span class="comment">// TODO if the dest array is empty then fail</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;480</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                    <span class="keyword">try</span> {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;481</td>
  <td class="nbHitsCovered">&nbsp;24</td>
  <td class="src"><pre class="src">&nbsp;                        <span class="keyword">for</span> (<span class="keyword">int</span> i = 0; i &lt; Array.getLength(orig); i++) {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;482</td>
  <td class="nbHitsCovered">&nbsp;18</td>
  <td class="src"><pre class="src">&nbsp;                            Object value = Array.get(orig, i);</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;483</td>
  <td class="nbHitsCovered">&nbsp;18</td>
  <td class="src"><pre class="src">&nbsp;                            <span class="keyword">if</span> (ignoreNulls &amp;&amp; value == <span class="keyword">null</span>) {</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;484</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                                <span class="comment">// don't copy this null over the existing value</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;485</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                            } <span class="keyword">else</span> {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;486</td>
  <td class="nbHitsCovered">&nbsp;18</td>
  <td class="src"><pre class="src">&nbsp;                                Array.set(dest, i, </pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;487</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                                        internalDeepClone(value, CopyDestination.ORIGINAL, maxDepth, <span class="keyword">null</span>, currentDepth, ignoreNulls, <span class="keyword">false</span>));</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;488</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                            }</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;489</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                        }</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;490</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;                    } <span class="keyword">catch</span> (ArrayIndexOutOfBoundsException e) {</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;491</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                        <span class="comment">// partial copy is ok, continue on</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;492</td>
  <td class="nbHitsCovered">&nbsp;6</td>
  <td class="src"><pre class="src">&nbsp;                    }</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;493</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                } <span class="keyword">else</span> {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;494</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;                    <span class="keyword">throw</span> <span class="keyword">new</span> IllegalArgumentException(<span class="string">"Cannot copy a simple value to a complex object"</span>);                  </span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;495</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                }</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;496</td>
  <td class="nbHitsCovered">&nbsp;12</td>
  <td class="src"><pre class="src">&nbsp;            } <span class="keyword">else</span> <span class="keyword">if</span> (Collection.<span class="keyword">class</span>.isAssignableFrom(origClass)) {</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;497</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                <span class="comment">// special case, copy everything from orig and add to dest</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;498</td>
  <td class="nbHitsCovered">&nbsp;4</td>
  <td class="src"><pre class="src">&nbsp;                <span class="keyword">for</span> (Object value : (Collection) orig) {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;499</td>
  <td class="nbHitsCovered">&nbsp;12</td>
  <td class="src"><pre class="src">&nbsp;                    <span class="keyword">if</span> (ignoreNulls &amp;&amp; value == <span class="keyword">null</span>) {</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;500</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                        <span class="comment">// don't copy this null over the existing value</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;501</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                    } <span class="keyword">else</span> {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;502</td>
  <td class="nbHitsCovered">&nbsp;12</td>
  <td class="src"><pre class="src">&nbsp;                        ((Collection) dest).add( </pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;503</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                                internalDeepClone(value, CopyDestination.ORIGINAL, maxDepth, <span class="keyword">null</span>, currentDepth, ignoreNulls, <span class="keyword">false</span>));</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;504</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                    }</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;505</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                }</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;506</td>
  <td class="nbHitsCovered">&nbsp;8</td>
  <td class="src"><pre class="src">&nbsp;            } <span class="keyword">else</span> <span class="keyword">if</span> (Map.<span class="keyword">class</span>.isAssignableFrom(origClass)) {</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;507</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                <span class="comment">// special case clone everything in the map except keys</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;508</td>
  <td class="nbHitsCovered">&nbsp;2</td>
  <td class="src"><pre class="src">&nbsp;                <span class="keyword">for</span> (Object key : ((Map) orig).keySet()) {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;509</td>
  <td class="nbHitsCovered">&nbsp;6</td>
  <td class="src"><pre class="src">&nbsp;                    <span class="keyword">if</span> ( fieldNamesToSkip != <span class="keyword">null</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;510</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                            &amp;&amp; fieldNamesToSkip.contains(key) ) {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;511</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;                        <span class="keyword">continue</span>; <span class="comment">// skip to next</span></span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;512</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                    }</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;513</td>
  <td class="nbHitsCovered">&nbsp;6</td>
  <td class="src"><pre class="src">&nbsp;                    Object value = ((Map) orig).get(key);</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;514</td>
  <td class="nbHitsCovered">&nbsp;6</td>
  <td class="src"><pre class="src">&nbsp;                    <span class="keyword">if</span> (ignoreNulls &amp;&amp; value == <span class="keyword">null</span>) {</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;515</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                        <span class="comment">// don't copy this null over the existing value</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;516</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                    } <span class="keyword">else</span> {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;517</td>
  <td class="nbHitsCovered">&nbsp;6</td>
  <td class="src"><pre class="src">&nbsp;                        ((Map) dest).put(key, </pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;518</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                                internalDeepClone(value, CopyDestination.ORIGINAL, maxDepth, <span class="keyword">null</span>, currentDepth, ignoreNulls, <span class="keyword">false</span>));</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;519</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                    }</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;520</td>
  <td class="nbHitsCovered">&nbsp;6</td>
  <td class="src"><pre class="src">&nbsp;                }</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;521</td>
  <td class="nbHitsCovered">&nbsp;6</td>
  <td class="src"><pre class="src">&nbsp;            } <span class="keyword">else</span> <span class="keyword">if</span> (getFieldAdapter().isAdaptableClass(origClass)) {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;522</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;                List&lt;String&gt; propertyNames = getFieldAdapter().getPropertyNames(orig);</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;523</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;                <span class="keyword">for</span> (String name : propertyNames) {</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;524</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;                    <span class="keyword">if</span> ( fieldNamesToSkip != <span class="keyword">null</span></span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;525</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                            &amp;&amp; fieldNamesToSkip.contains(name) ) {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;526</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;                        <span class="keyword">continue</span>; <span class="comment">// skip to next</span></span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;527</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                    }</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;528</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                    <span class="keyword">try</span> {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;529</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;                        Object value = getFieldAdapter().getSimpleValue(orig, name);</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;530</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;                        <span class="keyword">if</span> (ignoreNulls &amp;&amp; value == <span class="keyword">null</span>) {</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;531</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                            <span class="comment">// don't copy this null over the existing value</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;532</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                        } <span class="keyword">else</span> {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;533</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;                            getFieldUtils().setFieldValue(dest, name, </span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;534</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                                    internalDeepClone(value, CopyDestination.ORIGINAL, maxDepth, <span class="keyword">null</span>, currentDepth, ignoreNulls, <span class="keyword">false</span>));</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;535</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                        }</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;536</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;                    } <span class="keyword">catch</span> (FieldnameNotFoundException e) {</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;537</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                        <span class="comment">// it is ok for the objects to not be the same</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;538</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;                    } <span class="keyword">catch</span> (IllegalArgumentException e) {</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;539</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                        <span class="comment">// it is ok for the objects to not be the same</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;540</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;                    }</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;541</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                }</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;542</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;            } <span class="keyword">else</span> {</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;543</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                <span class="comment">// regular javabean</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;544</td>
  <td class="nbHitsCovered">&nbsp;6</td>
  <td class="src"><pre class="src">&nbsp;                Map&lt;String, Object&gt; values = getFieldUtils().getFieldValues(orig, FieldsFilter.READABLE, <span class="keyword">false</span>);</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;545</td>
  <td class="nbHitsCovered">&nbsp;6</td>
  <td class="src"><pre class="src">&nbsp;                <span class="keyword">for</span> (Entry&lt;String, Object&gt; entry : values.entrySet()) {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;546</td>
  <td class="nbHitsCovered">&nbsp;12</td>
  <td class="src"><pre class="src">&nbsp;                    String name = entry.getKey();</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;547</td>
  <td class="nbHitsCovered">&nbsp;12</td>
  <td class="src"><pre class="src">&nbsp;                    <span class="keyword">if</span> (ClassFields.FIELD_CLASS.equals(name)) {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;548</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;                        <span class="keyword">continue</span>; <span class="comment">// No point in trying to set an object's class</span></span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;549</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                    }</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;550</td>
  <td class="nbHitsCovered">&nbsp;12</td>
  <td class="src"><pre class="src">&nbsp;                    <span class="keyword">if</span> ( fieldNamesToSkip != <span class="keyword">null</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;551</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                            &amp;&amp; fieldNamesToSkip.contains(name) ) {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;552</td>
  <td class="nbHitsCovered">&nbsp;2</td>
  <td class="src"><pre class="src">&nbsp;                        <span class="keyword">continue</span>; <span class="comment">// skip to next</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;553</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                    }</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;554</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                    <span class="keyword">try</span> {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;555</td>
  <td class="nbHitsCovered">&nbsp;10</td>
  <td class="src"><pre class="src">&nbsp;                        Object value = getFieldUtils().getFieldValue(orig, name);</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;556</td>
  <td class="nbHitsCovered">&nbsp;10</td>
  <td class="src"><pre class="src">&nbsp;                        <span class="keyword">if</span> (ignoreNulls &amp;&amp; value == <span class="keyword">null</span>) {</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;557</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                            <span class="comment">// don't copy this null over the existing value</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;558</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                        } <span class="keyword">else</span> {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;559</td>
  <td class="nbHitsCovered">&nbsp;10</td>
  <td class="src"><pre class="src">&nbsp;                            getFieldUtils().setFieldValue(dest, name, </pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;560</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                                    internalDeepClone(value, CopyDestination.ORIGINAL, maxDepth, <span class="keyword">null</span>, currentDepth, ignoreNulls, <span class="keyword">false</span>));</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;561</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                        }</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;562</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;                    } <span class="keyword">catch</span> (FieldnameNotFoundException e) {</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;563</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                        <span class="comment">// this is ok, field might not exist or might not be readable so we skip it</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;564</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;                    } <span class="keyword">catch</span> (FieldGetValueException e) {</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;565</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                        <span class="comment">// this is ok, field might not be readable</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;566</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;                    } <span class="keyword">catch</span> (FieldSetValueException e) {</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;567</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                        <span class="comment">// this is ok, field might not be writeable</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;568</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;                    } <span class="keyword">catch</span> (IllegalArgumentException e) {</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;569</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                        <span class="comment">// this is ok, failure should not stop the clone</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;570</td>
  <td class="nbHitsCovered">&nbsp;10</td>
  <td class="src"><pre class="src">&nbsp;                    }</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;571</td>
  <td class="nbHitsCovered">&nbsp;10</td>
  <td class="src"><pre class="src">&nbsp;                }</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;572</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;            }</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;573</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;        } <span class="keyword">catch</span> (Exception e) {</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;574</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;            <span class="comment">// catch any possible thrown exception and translate (this is not a mistake so ignore findbugs)</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;575</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;            <span class="keyword">throw</span> <span class="keyword">new</span> IllegalArgumentException(<span class="string">"Failure copying "</span> + orig + <span class="string">" ("</span>+origClass+<span class="string">") to "</span> </span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;576</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                    + dest + <span class="string">" ("</span>+destClass+<span class="string">")"</span> + e.getMessage(), e);</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;577</td>
  <td class="nbHitsCovered">&nbsp;18</td>
  <td class="src"><pre class="src">&nbsp;        }</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;578</td>
  <td class="nbHitsCovered">&nbsp;18</td>
  <td class="src"><pre class="src">&nbsp;    }</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;579</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;580</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    @Override</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;581</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="keyword">public</span> String toString() {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;582</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;        <span class="keyword">return</span> <span class="string">"Deep:"</span>+getClassDataCacher();</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;583</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    }</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;584</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;585</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="comment">// STATIC access</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;586</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;587</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="keyword">protected</span> <span class="keyword">static</span> SoftReference&lt;DeepUtils&gt; instanceStorage;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;588</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="comment">/**</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;589</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * Get a singleton instance of this class to work with (stored statically) &lt;br/&gt;</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;590</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * &lt;b&gt;WARNING&lt;/b&gt;: do not hold onto this object or cache it yourself, call this method again if you need it again</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;591</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @return a singleton instance of this class</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;592</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     */</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;593</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="keyword">public</span> <span class="keyword">static</span> DeepUtils getInstance() {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;594</td>
  <td class="nbHitsCovered">&nbsp;28</td>
  <td class="src"><pre class="src">&nbsp;        DeepUtils instance = (instanceStorage == <span class="keyword">null</span> ? <span class="keyword">null</span> : instanceStorage.get());</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;595</td>
  <td class="nbHitsCovered">&nbsp;28</td>
  <td class="src"><pre class="src">&nbsp;        <span class="keyword">if</span> (instance == <span class="keyword">null</span>) {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;596</td>
  <td class="nbHitsCovered">&nbsp;1</td>
  <td class="src"><pre class="src">&nbsp;            instance = DeepUtils.setInstance(<span class="keyword">null</span>);</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;597</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        }</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;598</td>
  <td class="nbHitsCovered">&nbsp;28</td>
  <td class="src"><pre class="src">&nbsp;        <span class="keyword">return</span> instance;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;599</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    }</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;600</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="comment">/**</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;601</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * Set the singleton instance of the class which will be stored statically</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;602</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param instance the instance to use as the singleton instance</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;603</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     */</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;604</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="keyword">public</span> <span class="keyword">static</span> DeepUtils setInstance(DeepUtils newInstance) {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;605</td>
  <td class="nbHitsCovered">&nbsp;10</td>
  <td class="src"><pre class="src">&nbsp;        DeepUtils instance = newInstance;</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;606</td>
  <td class="nbHitsCovered">&nbsp;10</td>
  <td class="src"><pre class="src">&nbsp;        <span class="keyword">if</span> (instance == <span class="keyword">null</span>) {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;607</td>
  <td class="nbHitsCovered">&nbsp;1</td>
  <td class="src"><pre class="src">&nbsp;            instance = <span class="keyword">new</span> DeepUtils();</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;608</td>
  <td class="nbHitsCovered">&nbsp;1</td>
  <td class="src"><pre class="src">&nbsp;            instance.singleton = <span class="keyword">true</span>;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;609</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        }</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;610</td>
  <td class="nbHitsCovered">&nbsp;10</td>
  <td class="src"><pre class="src">&nbsp;        DeepUtils.timesCreated++;</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;611</td>
  <td class="nbHitsCovered">&nbsp;10</td>
  <td class="src"><pre class="src">&nbsp;        instanceStorage = <span class="keyword">new</span> SoftReference&lt;DeepUtils&gt;(instance);</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;612</td>
  <td class="nbHitsCovered">&nbsp;10</td>
  <td class="src"><pre class="src">&nbsp;        <span class="keyword">return</span> instance;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;613</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    }</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;614</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;615</td>
  <td class="nbHitsCovered">&nbsp;1</td>
  <td class="src"><pre class="src">&nbsp;    <span class="keyword">private</span> <span class="keyword">static</span> <span class="keyword">int</span> timesCreated = 0;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;616</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="keyword">public</span> <span class="keyword">static</span> <span class="keyword">int</span> getTimesCreated() {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;617</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;        <span class="keyword">return</span> timesCreated;</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;618</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    }</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;619</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;620</td>
  <td class="nbHitsCovered">&nbsp;9</td>
  <td class="src"><pre class="src">&nbsp;    <span class="keyword">private</span> <span class="keyword">boolean</span> singleton = <span class="keyword">false</span>;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;621</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="comment">/**</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;622</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @return true if this object is the singleton</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;623</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     */</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;624</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="keyword">public</span> <span class="keyword">boolean</span> isSingleton() {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;625</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;        <span class="keyword">return</span> singleton;</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;626</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    }</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;627</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;628</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;}</pre></td>
</tr>
</table>
<div class="footer">
Reports generated by <a href="http://cobertura.sourceforge.net/" target="_top">Cobertura</a>.
</div>
</body>
</html>
